package org.selenium;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

/**
 * @Author: fzykd
 * Date: 2024-05-04
 * Time: 13:42
 * User: LQH
 */


public class Demo {

    public static void main(String[] args) {
        //IllegalStateException
        System.setProperty("webdriver.chrome.driver", "E:/software/Java/bin/chromedriver.exe");
        // 谷歌驱动
        ChromeOptions options = new ChromeOptions();
        // 允许所有请求
        options.addArguments("--remote-allow-origins=*");

        WebDriver webDriver = new ChromeDriver(options);
        // 启动需要打开的网页
        webDriver.get("https://www.baidu.com");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        webDriver.quit();
    }

}